<?php

namespace App\Http\Requests;

class FeedBackRequest extends Request
{
    public function rules()
    {
        switch($this->method())
        {
            // CREATE
            case 'POST':
            {
                return [
                    'content' => 'required|max:255|min:10'
                ];
            }
            // UPDATE
            case 'PUT':
            case 'PATCH':
            {
                return [
                    // UPDATE ROLES
                ];
            }
            case 'GET':
            case 'DELETE':
            default:
            {
                return [];
            };
        }
    }

    public function messages()
    {
        return [
            'content.required' => '请填写您的意见或者建议',
            'content.max'      => '您的意见太长了！',
            'content.min'      => '请填写至少10个字！'
        ];
    }
}
